﻿@model DateTime?
@{
    var o = this; // instancia um objeto da view
    var required = o.ViewData.ModelMetadata.IsRequired;
    var obrigatorio = required ? " obrigatorio" : "";
}
@Html.TextBox("", (Model.HasValue ? Model.Value.ToShortDateString() : string.Empty), new { maxlength = 10, @class = "datepicker" + obrigatorio, data_mindate = DateTime.Now.AddYears(-3), data_maxdate = DateTime.Now.AddYears(10) })
